package com.cyy.recruit.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.cyy.recruit.pojo.Recruit;

import java.util.List;

/**
 * recruit数据访问接口
 * @author Administrator
 *
 */
public interface RecruitDao extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit>{

    /**
     * 根据状态查询前三条并按创建时间降序排列
     * @param state
     * @return
     */
    public List<Recruit> findTop3ByStateOrderByCreatetimeDesc(String state);

    public List<Recruit> findTop2ByStateNotOrderByCreatetimeDesc(String state);
}
